package com.vehicle.controller.adminController;

import com.vehicle.pojo.Cars;
import com.vehicle.result.Result;
import com.vehicle.service.AdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;

    /**
     * 添加车辆信息
     * @param cars
     * @return
     */
    @PutMapping("/add")
    public Result addCar(@RequestBody Cars cars){
        adminService.addCar(cars);
        log.info("add");
        return Result.success();
    }

    /**从
     * 更新车辆信息
     * @param cars
     * @return
     */
    @PutMapping("/update")
    public Result updateCar(@RequestBody Cars cars){
        adminService.updateCar(cars);
        log.info("update");
        return Result.success();
    }
}
